package ywpt.service.system;

import java.util.List;

import ywpt.components.acegi.domain.Role;

import org.hibernate.criterion.DetachedCriteria;

public interface RoleService {
	public abstract Role getRoleById(Long id);

	public abstract List<Role> getAllRoles();

	public abstract List<Role> findAllRolesByCriteria(DetachedCriteria query);
	
	public abstract List<Role> findAllRolesByCriteria(DetachedCriteria query,int pageSize,int startIndex);
	
	public abstract void saveRole(Role role);
	
	public abstract void updateRole(Role role);
	
	public abstract void addResources(Role role, List<Long> resources);

	public abstract void removeRole(Long id);
	
	public abstract int[] removeRoles(Long[] ids);
	
	public abstract int[] removeResources(Role role, Long[] ids);

	public abstract int getRolesCountByCriteria(DetachedCriteria query);

	public abstract List getRoleTree();
}